import { createApp } from 'vue'
import App from './App.vue'
import router from './router'
import store from './store'
// 1. 引入组件样式
import 'vant/lib/index.css';
// 2. 全量引入组件库
import Vant from 'vant';

// 图片懒加载和裂图的插件
import VueLazyloadNext from 'vue-lazyload-next'

import { createPinia } from 'pinia'
import piniaPluginPersistedstate from 'pinia-plugin-persistedstate'

// 引入图片
const loadimage = require('./assets/logo.png') // 懒加载
const errorimage = require('./assets/error.png') // 裂图

// 3.注册组件库
createApp(App).use(createPinia().use(piniaPluginPersistedstate)).use(store).use(router).use(Vant).use(
    VueLazyloadNext,
    {
        preLoad: 1.3,
        error: errorimage,
        loading: loadimage,
        attempt: 1
    }
).mount('#app')


